package seven.test_7_30;

import java.util.Arrays;
import java.util.Scanner;

public class TestMain2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        int[] arrm = new int[m];
        int[] arrn = new int[n];
        for (int i = 0; i < m; i++) {
            arrm[i] = scanner.nextInt();
        }
        for (int i = 0; i < n; i++) {
            arrn[i] = scanner.nextInt();
        }
        Arrays.sort(arrm);
        Arrays.sort(arrn);
        int i = 0;
        while (i < m && i < n) {

        }
    }
}
